<template>
    <fieldset>
        <legend>购物车</legend>
        <ul>
            <li v-for="(item,index) in checked" :key="item.id">
                <b>商品名称:{{item.title}}</b>
                ----------
                <b>商品价格:{{item.price}}</b>
                ----------
                <b>购买数量:{{item.count}}</b>
                -----
                <button @click="SUBTRACT(item,index)">-</button>
                <button >+</button>

            </li>
        </ul>
        <div>总价:{{total}}</div>
    </fieldset>

</template>
<script>
import { mapState,mapGetters,mapActions } from 'vuex';

    export default{
        computed:{
            ...mapState('shop',['checked']),
            ...mapGetters('shop',['total']),

        },
        methods: {
            ...mapActions('shop',['SUBTRACT']),
        },
        mounted(){
        }
    }


</script>